package activity.addCamera;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;
import com.hichip.campro.R;
import base.HiActivity;
import butterknife.BindView;
import common.TitleView;
import main.MainActivity;
/**
 * 已接入网线和 为接入网线
 * Created by lt on 018\2\9 0009.
 */

public class AddNewDeviceActivity extends HiActivity implements View.OnClickListener {
    @BindView(R.id.title) TitleView title;
    @BindView(R.id.tv_access_network_adddevice) TextView tv_access_network_adddevice;
    @BindView(R.id.tv_wireless_adddevice) TextView tv_wireless_adddevice;


    @Override
    protected int setLayoutId() {
        return R.layout.activity_add_new_device;
    }

    @Override
    protected void init(@Nullable Bundle savedInstanceState) {
        initViewAndData();
        setListeners();
    }

    private void setListeners() {
        tv_access_network_adddevice.setOnClickListener(this);
        tv_wireless_adddevice.setOnClickListener(this);
    }

    private void initViewAndData() {
        title.setTitle(getString(R.string.confirm_net_cable));
        title.setButton(TitleView.NAVIGATION_BUTTON_LEFT);
        title.setRightTxtBack(R.mipmap.x_bule);
        title.setNavigationBarButtonListener(new TitleView.NavigationBarButtonListener() {
            @Override
            public void OnNavigationButtonClick(int which) {
                switch (which) {
                    case TitleView.NAVIGATION_BUTTON_LEFT:
                        AddNewDeviceActivity.this.finish();
                        break;
                    case TitleView.NAVIGATION_BUTTON_IV_RIGHT:
                        Intent intent=new Intent(AddNewDeviceActivity.this, MainActivity.class);
                        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                        startActivity(intent,true);
                        break;
                }
            }
        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_access_network_adddevice://接入网线添加设备
                //Intent intent = new Intent(AddNewDeviceActivity.this, CaptureActivity.class);
                Intent intent = new Intent(AddNewDeviceActivity.this, LANSearchCameraActivity.class);
                intent.putExtra("category", 4);
                startActivity(intent);
                break;
            case R.id.tv_wireless_adddevice://无线连接添加设备
                intent = new Intent(AddNewDeviceActivity.this, SeleApOrSoundwaveActivty.class);
                startActivity(intent);
                break;
        }
    }

}
















